home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / bouncegame.swf / scripts / frame_85 / PlaceObject2_156_17 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-20  |  2.6 KB  |  91 lines

  1. onClipEvent(enterFrame){
  2.    if(!_root.main.gonogo)
  3.    {
  4.       return undefined;
  5.    }
  6.    if(this._name != "person")
  7.    {
  8.       vely += a;
  9.       x += velx;
  10.       y += vely;
  11.       if(_parent.bouncer._y < y && _parent.bouncer._x - _parent.bouncer._width / 2 < x && x < _parent.bouncer._x + _parent.bouncer._width / 2)
  12.       {
  13.          boing.start(0,1);
  14.          if(this._currentframe == this._totalframes)
  15.          {
  16.             vely *= -0.85;
  17.          }
  18.          else
  19.          {
  20.             vely *= -0.9;
  21.          }
  22.          y = _root.bouncer._y - _root.bouncer._height / 2 - this._height / 2 - 1;
  23.          _parent.bouncer.gotoAndPlay(2);
  24.       }
  25.       if(_root.end._x - _root.end._width / 2 < x && (y + this._height / 2 < _root.end._y || 0 < vely))
  26.       {
  27.          if(_root.end._y < y + this._height / 2)
  28.          {
  29.             y = _parent.end._y - this._height / 2;
  30.             this.landed = true;
  31.          }
  32.       }
  33.       if(500 < x - this._width / 2)
  34.       {
  35.          if(this._currentframe < this._totalframes)
  36.          {
  37.             _root.main.score += _root.main.regular_score;
  38.          }
  39.          else
  40.          {
  41.             _root.main.score += _root.main.fat_score;
  42.          }
  43.          if(_root.main.score % _root.main.extra_life_points == 0)
  44.          {
  45.             _root.main.lives = _root.main.lives + 1;
  46.          }
  47.          if(_root.main.score % _root.main.num_points_level == 0)
  48.          {
  49.             _root.main.difficulty = _root.main.difficulty + 1;
  50.             if(_root.main.lowest_frames < _root.main.num_frames_pass)
  51.             {
  52.                _root.main.num_frames_pass -= _root.main.num_frames_away;
  53.             }
  54.          }
  55.          this.removeMovieClip();
  56.       }
  57.       if(415 < y)
  58.       {
  59.          _root.main.lives--;
  60.          _root.splat._x = x;
  61.          _root.splat._y = 405;
  62.          _root.splat.play();
  63.          splat.start(0,1);
  64.          this.removeMovieClip();
  65.       }
  66.       this._x = x;
  67.       this._y = y;
  68.       if(this.landed)
  69.       {
  70.          this.tomato.gotoAndStop("finished");
  71.       }
  72.       else if(-4 < vely && vely < 4)
  73.       {
  74.          this.swapDepths(2000 + Math.floor(Math.random() * 1000));
  75.          this.tomato.gotoAndStop("peak");
  76.       }
  77.       else if(_parent.bouncer._x - _parent.bouncer._width / 2 < this._x && this._x < _parent.bouncer._x + _parent.bouncer._width / 2 && _parent.bouncer._y - this._y < 50)
  78.       {
  79.          this.tomato.gotoAndStop("landed");
  80.       }
  81.       else if(vely < 0)
  82.       {
  83.          this.tomato.gotoAndStop("going_up");
  84.       }
  85.       else if(0 < vely)
  86.       {
  87.          this.tomato.gotoAndStop("going_down");
  88.       }
  89.    }
  90. }
  91.